{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import sys\n",
    "from configure.settings import get_tushare_pro,DBSelector\n",
    "pro =get_tushare_pro()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "outputs": [],
   "source": [
    "df = pro.top10_holders(ts_code='600000.SH', start_date='20220930', end_date='20221231')"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "outputs": [
    {
     "data": {
      "text/plain": "     ts_code  ann_date  end_date         holder_name   hold_amount  hold_ratio\n0  600000.SH  20221029  20220930          上海国际集团有限公司  6.331323e+09       21.57\n1  600000.SH  20221029  20220930      中国移动通信集团广东有限公司  5.334893e+09       18.18\n2  600000.SH  20221029  20220930   富德生命人寿保险股份有限公司-传统  2.779437e+09        9.47\n3  600000.SH  20221029  20220930  富德生命人寿保险股份有限公司-资本金  1.763232e+09        6.01\n4  600000.SH  20221029  20220930       上海上国投资产管理有限公司  1.395571e+09        4.75\n5  600000.SH  20221029  20220930  富德生命人寿保险股份有限公司-万能H  1.270429e+09        4.33\n6  600000.SH  20221029  20220930        中国证券金融股份有限公司  1.179109e+09        4.02\n7  600000.SH  20221029  20220930        上海国鑫投资发展有限公司  9.455690e+08        3.22\n8  600000.SH  20221029  20220930     香港中央结算有限公司(陆股通)  5.720716e+08        1.95\n9  600000.SH  20221029  20220930      中央汇金资产管理有限责任公司  3.871747e+08        1.32",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>ts_code</th>\n      <th>ann_date</th>\n      <th>end_date</th>\n      <th>holder_name</th>\n      <th>hold_amount</th>\n      <th>hold_ratio</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>600000.SH</td>\n      <td>20221029</td>\n      <td>20220930</td>\n      <td>上海国际集团有限公司</td>\n      <td>6.331323e+09</td>\n      <td>21.57</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>600000.SH</td>\n      <td>20221029</td>\n      <td>20220930</td>\n      <td>中国移动通信集团广东有限公司</td>\n      <td>5.334893e+09</td>\n      <td>18.18</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>600000.SH</td>\n      <td>20221029</td>\n      <td>20220930</td>\n      <td>富德生命人寿保险股份有限公司-传统</td>\n      <td>2.779437e+09</td>\n      <td>9.47</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>600000.SH</td>\n      <td>20221029</td>\n      <td>20220930</td>\n      <td>富德生命人寿保险股份有限公司-资本金</td>\n      <td>1.763232e+09</td>\n      <td>6.01</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>600000.SH</td>\n      <td>20221029</td>\n      <td>20220930</td>\n      <td>上海上国投资产管理有限公司</td>\n      <td>1.395571e+09</td>\n      <td>4.75</td>\n    </tr>\n    <tr>\n      <th>5</th>\n      <td>600000.SH</td>\n      <td>20221029</td>\n      <td>20220930</td>\n      <td>富德生命人寿保险股份有限公司-万能H</td>\n      <td>1.270429e+09</td>\n      <td>4.33</td>\n    </tr>\n    <tr>\n      <th>6</th>\n      <td>600000.SH</td>\n      <td>20221029</td>\n      <td>20220930</td>\n      <td>中国证券金融股份有限公司</td>\n      <td>1.179109e+09</td>\n      <td>4.02</td>\n    </tr>\n    <tr>\n      <th>7</th>\n      <td>600000.SH</td>\n      <td>20221029</td>\n      <td>20220930</td>\n      <td>上海国鑫投资发展有限公司</td>\n      <td>9.455690e+08</td>\n      <td>3.22</td>\n    </tr>\n    <tr>\n      <th>8</th>\n      <td>600000.SH</td>\n      <td>20221029</td>\n      <td>20220930</td>\n      <td>香港中央结算有限公司(陆股通)</td>\n      <td>5.720716e+08</td>\n      <td>1.95</td>\n    </tr>\n    <tr>\n      <th>9</th>\n      <td>600000.SH</td>\n      <td>20221029</td>\n      <td>20220930</td>\n      <td>中央汇金资产管理有限责任公司</td>\n      <td>3.871747e+08</td>\n      <td>1.32</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "outputs": [],
   "source": [
    "def get_AStock_code():\n",
    "    conn = DBSelector().get_mysql_conn('db_daily','tencent-1c')\n",
    "    cursor = conn.cursor()\n",
    "    sql_str = 'select code from `2023-03-17`'\n",
    "    cursor.execute(sql_str)\n",
    "    ret = cursor.fetchall()\n",
    "    result = []\n",
    "    for item in ret:\n",
    "        code = item[0]\n",
    "        if code.startswith('8'):\n",
    "            continue\n",
    "        if code.startswith('6'):\n",
    "            code = code+'.SH'\n",
    "        else:\n",
    "            code = code+'.SZ'\n",
    "        result.append(code)\n",
    "    return result\n",
    "\n",
    "result = get_AStock_code()\n",
    "# result\n"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "outputs": [
    {
     "data": {
      "text/plain": "5033"
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(result)\n"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "outputs": [],
   "source": [
    "import time\n",
    "def get_top_holder(code):\n",
    "    df = pro.top10_floatholders(ts_code=code, start_date='20220930', end_date='20221231')\n",
    "    time.sleep(0.1)\n",
    "    return df\n",
    "all_stock_top_hold = []\n",
    "\n",
    "for code in result:\n",
    "    df = get_top_holder(code)\n",
    "    all_stock_top_hold.append(df)"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "outputs": [
    {
     "data": {
      "text/plain": "5033"
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(all_stock_top_hold)\n"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "outputs": [
    {
     "data": {
      "text/plain": "     ts_code  ann_date  end_date                           holder_name  \\\n0  688981.SH  20221111  20220930                  国家集成电路产业投资基金二期股份有限公司   \n1  688981.SH  20221111  20220930                        中国信息通信科技集团有限公司   \n2  688981.SH  20221111  20220930  招商银行股份有限公司-华夏上证科创板50成份交易型开放式指数证券投资基金   \n3  688981.SH  20221111  20220930                              国新投资有限公司   \n4  688981.SH  20221111  20220930            招商银行股份有限公司-银河创新成长混合型证券投资基金   \n5  688981.SH  20221111  20220930  中国建设银行股份有限公司-华夏国证半导体芯片交易型开放式指数证券投资基金   \n6  688981.SH  20221111  20220930                  青岛聚源芯星股权投资合伙企业(有限合伙)   \n\n   hold_amount  \n0  127458120.0  \n1   72470855.0  \n2   56553626.0  \n3   36416605.0  \n4   30500000.0  \n5   28657990.0  \n6   26599833.0  ",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>ts_code</th>\n      <th>ann_date</th>\n      <th>end_date</th>\n      <th>holder_name</th>\n      <th>hold_amount</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>688981.SH</td>\n      <td>20221111</td>\n      <td>20220930</td>\n      <td>国家集成电路产业投资基金二期股份有限公司</td>\n      <td>127458120.0</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>688981.SH</td>\n      <td>20221111</td>\n      <td>20220930</td>\n      <td>中国信息通信科技集团有限公司</td>\n      <td>72470855.0</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>688981.SH</td>\n      <td>20221111</td>\n      <td>20220930</td>\n      <td>招商银行股份有限公司-华夏上证科创板50成份交易型开放式指数证券投资基金</td>\n      <td>56553626.0</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>688981.SH</td>\n      <td>20221111</td>\n      <td>20220930</td>\n      <td>国新投资有限公司</td>\n      <td>36416605.0</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>688981.SH</td>\n      <td>20221111</td>\n      <td>20220930</td>\n      <td>招商银行股份有限公司-银河创新成长混合型证券投资基金</td>\n      <td>30500000.0</td>\n    </tr>\n    <tr>\n      <th>5</th>\n      <td>688981.SH</td>\n      <td>20221111</td>\n      <td>20220930</td>\n      <td>中国建设银行股份有限公司-华夏国证半导体芯片交易型开放式指数证券投资基金</td>\n      <td>28657990.0</td>\n    </tr>\n    <tr>\n      <th>6</th>\n      <td>688981.SH</td>\n      <td>20221111</td>\n      <td>20220930</td>\n      <td>青岛聚源芯星股权投资合伙企业(有限合伙)</td>\n      <td>26599833.0</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "all_stock_top_hold[0]\n"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "outputs": [],
   "source": [
    "import pandas as pd"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "outputs": [],
   "source": [
    "all_stock_holder_df = pd.concat(all_stock_top_hold)"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "outputs": [
    {
     "data": {
      "text/plain": "     ts_code  ann_date  end_date                           holder_name  \\\n0  688981.SH  20221111  20220930                  国家集成电路产业投资基金二期股份有限公司   \n1  688981.SH  20221111  20220930                        中国信息通信科技集团有限公司   \n2  688981.SH  20221111  20220930  招商银行股份有限公司-华夏上证科创板50成份交易型开放式指数证券投资基金   \n3  688981.SH  20221111  20220930                              国新投资有限公司   \n4  688981.SH  20221111  20220930            招商银行股份有限公司-银河创新成长混合型证券投资基金   \n\n   hold_amount  \n0  127458120.0  \n1   72470855.0  \n2   56553626.0  \n3   36416605.0  \n4   30500000.0  ",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>ts_code</th>\n      <th>ann_date</th>\n      <th>end_date</th>\n      <th>holder_name</th>\n      <th>hold_amount</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>688981.SH</td>\n      <td>20221111</td>\n      <td>20220930</td>\n      <td>国家集成电路产业投资基金二期股份有限公司</td>\n      <td>127458120.0</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>688981.SH</td>\n      <td>20221111</td>\n      <td>20220930</td>\n      <td>中国信息通信科技集团有限公司</td>\n      <td>72470855.0</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>688981.SH</td>\n      <td>20221111</td>\n      <td>20220930</td>\n      <td>招商银行股份有限公司-华夏上证科创板50成份交易型开放式指数证券投资基金</td>\n      <td>56553626.0</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>688981.SH</td>\n      <td>20221111</td>\n      <td>20220930</td>\n      <td>国新投资有限公司</td>\n      <td>36416605.0</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>688981.SH</td>\n      <td>20221111</td>\n      <td>20220930</td>\n      <td>招商银行股份有限公司-银河创新成长混合型证券投资基金</td>\n      <td>30500000.0</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "all_stock_holder_df.head()"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "688786.SH\n",
      "688621.SH\n",
      "688597.SH\n",
      "688586.SH\n",
      "688569.SH\n",
      "688555.SH\n",
      "688508.SH\n",
      "688323.SH\n",
      "688309.SH\n",
      "688303.SH\n",
      "688301.SH\n",
      "688233.SH\n",
      "688203.SH\n",
      "688195.SH\n",
      "688162.SH\n",
      "688100.SH\n",
      "688093.SH\n",
      "688091.SH\n",
      "688086.SH\n",
      "688082.SH\n",
      "688019.SH\n",
      "605377.SH\n",
      "605366.SH\n",
      "605339.SH\n",
      "605299.SH\n",
      "605189.SH\n",
      "605178.SH\n",
      "605090.SH\n",
      "603993.SH\n",
      "603956.SH\n",
      "603929.SH\n",
      "603881.SH\n",
      "603860.SH\n",
      "603856.SH\n",
      "603813.SH\n",
      "603758.SH\n",
      "603682.SH\n",
      "603615.SH\n",
      "603606.SH\n",
      "603603.SH\n",
      "603595.SH\n",
      "603557.SH\n",
      "603501.SH\n",
      "603456.SH\n",
      "603393.SH\n",
      "603348.SH\n",
      "603335.SH\n",
      "603330.SH\n",
      "603319.SH\n",
      "603317.SH\n",
      "603305.SH\n",
      "603303.SH\n",
      "603301.SH\n",
      "603267.SH\n",
      "603200.SH\n",
      "603186.SH\n",
      "603185.SH\n",
      "603169.SH\n",
      "603166.SH\n",
      "603133.SH\n",
      "603117.SH\n",
      "603105.SH\n",
      "603103.SH\n",
      "603093.SH\n",
      "603077.SH\n",
      "603039.SH\n",
      "603031.SH\n",
      "603021.SH\n",
      "603007.SH\n",
      "601996.SH\n",
      "601901.SH\n",
      "601788.SH\n",
      "601766.SH\n",
      "601698.SH\n",
      "601669.SH\n",
      "601633.SH\n",
      "601618.SH\n",
      "601608.SH\n",
      "601390.SH\n",
      "601318.SH\n",
      "601186.SH\n",
      "601138.SH\n",
      "601068.SH\n",
      "601021.SH\n",
      "601006.SH\n",
      "600989.SH\n",
      "600984.SH\n",
      "600976.SH\n",
      "600973.SH\n",
      "600963.SH\n",
      "600962.SH\n",
      "600955.SH\n",
      "600887.SH\n",
      "600873.SH\n",
      "600865.SH\n",
      "600862.SH\n",
      "600861.SH\n",
      "600839.SH\n",
      "600820.SH\n",
      "600817.SH\n",
      "600816.SH\n",
      "600805.SH\n",
      "600804.SH\n",
      "600800.SH\n",
      "600795.SH\n",
      "600793.SH\n",
      "600781.SH\n",
      "600779.SH\n",
      "600767.SH\n",
      "600765.SH\n",
      "600759.SH\n",
      "600742.SH\n",
      "600734.SH\n",
      "600732.SH\n",
      "600726.SH\n",
      "600722.SH\n",
      "600719.SH\n",
      "600715.SH\n",
      "600710.SH\n",
      "600705.SH\n",
      "600698.SH\n",
      "600691.SH\n",
      "600681.SH\n",
      "600671.SH\n",
      "600666.SH\n",
      "600665.SH\n",
      "600660.SH\n",
      "600654.SH\n",
      "600644.SH\n",
      "600608.SH\n",
      "600605.SH\n",
      "600601.SH\n",
      "600599.SH\n",
      "600589.SH\n",
      "600583.SH\n",
      "600577.SH\n",
      "600568.SH\n",
      "600557.SH\n",
      "600539.SH\n",
      "600532.SH\n",
      "600528.SH\n",
      "600523.SH\n",
      "600518.SH\n",
      "600513.SH\n",
      "600507.SH\n",
      "600488.SH\n",
      "600470.SH\n",
      "600462.SH\n",
      "600444.SH\n",
      "600433.SH\n",
      "600423.SH\n",
      "600408.SH\n",
      "600388.SH\n",
      "600382.SH\n",
      "600380.SH\n",
      "600372.SH\n",
      "600365.SH\n",
      "600356.SH\n",
      "600332.SH\n",
      "600328.SH\n",
      "600321.SH\n",
      "600316.SH\n",
      "600311.SH\n",
      "600306.SH\n",
      "600305.SH\n",
      "600303.SH\n",
      "600301.SH\n",
      "600290.SH\n",
      "600289.SH\n",
      "600265.SH\n",
      "600256.SH\n",
      "600255.SH\n",
      "600252.SH\n",
      "600242.SH\n",
      "600241.SH\n",
      "600239.SH\n",
      "600237.SH\n",
      "600226.SH\n",
      "600217.SH\n",
      "600211.SH\n",
      "600182.SH\n",
      "600168.SH\n",
      "600163.SH\n",
      "600139.SH\n",
      "600136.SH\n",
      "600122.SH\n",
      "600113.SH\n",
      "600112.SH\n",
      "600089.SH\n",
      "600078.SH\n",
      "600071.SH\n",
      "600063.SH\n",
      "600050.SH\n",
      "600039.SH\n",
      "600038.SH\n",
      "600021.SH\n",
      "600015.SH\n",
      "301256.SZ\n",
      "301192.SZ\n",
      "301179.SZ\n",
      "301171.SZ\n",
      "301127.SZ\n",
      "301076.SZ\n",
      "301071.SZ\n",
      "301066.SZ\n",
      "301059.SZ\n",
      "301046.SZ\n",
      "300896.SZ\n",
      "300890.SZ\n",
      "300818.SZ\n",
      "300796.SZ\n",
      "300765.SZ\n",
      "300750.SZ\n",
      "300721.SZ\n",
      "300708.SZ\n",
      "300700.SZ\n",
      "300674.SZ\n",
      "300654.SZ\n",
      "300578.SZ\n",
      "300496.SZ\n",
      "300422.SZ\n",
      "300401.SZ\n",
      "300354.SZ\n",
      "300349.SZ\n",
      "300346.SZ\n",
      "300286.SZ\n",
      "300281.SZ\n",
      "300211.SZ\n",
      "300146.SZ\n",
      "300139.SZ\n",
      "300120.SZ\n",
      "300087.SZ\n",
      "300059.SZ\n",
      "300033.SZ\n",
      "300006.SZ\n",
      "003816.SZ\n",
      "003037.SZ\n",
      "003011.SZ\n",
      "002984.SZ\n",
      "002972.SZ\n",
      "002966.SZ\n",
      "002947.SZ\n",
      "002916.SZ\n",
      "002912.SZ\n",
      "002881.SZ\n",
      "002879.SZ\n",
      "002865.SZ\n",
      "002846.SZ\n",
      "002812.SZ\n",
      "002805.SZ\n",
      "002782.SZ\n",
      "002777.SZ\n",
      "002759.SZ\n",
      "002741.SZ\n",
      "002682.SZ\n",
      "002668.SZ\n",
      "002667.SZ\n",
      "002616.SZ\n",
      "002579.SZ\n",
      "002566.SZ\n",
      "002560.SZ\n",
      "002556.SZ\n",
      "002532.SZ\n",
      "002514.SZ\n",
      "002419.SZ\n",
      "002379.SZ\n",
      "002315.SZ\n",
      "002285.SZ\n",
      "002258.SZ\n",
      "002240.SZ\n",
      "002233.SZ\n",
      "002190.SZ\n",
      "002188.SZ\n",
      "002179.SZ\n",
      "002162.SZ\n",
      "002138.SZ\n",
      "002134.SZ\n",
      "002105.SZ\n",
      "002080.SZ\n",
      "002072.SZ\n",
      "002056.SZ\n",
      "002014.SZ\n",
      "001979.SZ\n",
      "001914.SZ\n",
      "001207.SZ\n",
      "001205.SZ\n",
      "000988.SZ\n",
      "000975.SZ\n",
      "000972.SZ\n",
      "000915.SZ\n",
      "000815.SZ\n",
      "000798.SZ\n",
      "000795.SZ\n",
      "000783.SZ\n",
      "000739.SZ\n",
      "000708.SZ\n",
      "000702.SZ\n",
      "000690.SZ\n",
      "000665.SZ\n",
      "000663.SZ\n",
      "000608.SZ\n",
      "000534.SZ\n",
      "000503.SZ\n",
      "000408.SZ\n",
      "000407.SZ\n",
      "000063.SZ\n",
      "000062.SZ\n",
      "000061.SZ\n",
      "000055.SZ\n",
      "000050.SZ\n",
      "000048.SZ\n",
      "000029.SZ\n",
      "000026.SZ\n",
      "000001.SZ\n",
      "688555.SH\n",
      "688309.SH\n",
      "688086.SH\n",
      "603603.SH\n",
      "603557.SH\n",
      "603117.SH\n",
      "603039.SH\n",
      "603007.SH\n",
      "600984.SH\n",
      "600962.SH\n",
      "600817.SH\n",
      "600816.SH\n",
      "600804.SH\n",
      "600793.SH\n",
      "600781.SH\n",
      "600779.SH\n",
      "600767.SH\n",
      "600759.SH\n",
      "600734.SH\n",
      "600732.SH\n",
      "600726.SH\n",
      "600722.SH\n",
      "600719.SH\n",
      "600715.SH\n",
      "600710.SH\n",
      "600691.SH\n",
      "600671.SH\n",
      "600666.SH\n",
      "600654.SH\n",
      "600644.SH\n",
      "600608.SH\n",
      "600601.SH\n",
      "600599.SH\n",
      "600589.SH\n",
      "600568.SH\n",
      "600539.SH\n",
      "600532.SH\n",
      "600518.SH\n",
      "600462.SH\n",
      "600444.SH\n",
      "600408.SH\n",
      "600388.SH\n",
      "600382.SH\n",
      "600365.SH\n",
      "600311.SH\n",
      "600306.SH\n",
      "600303.SH\n",
      "600301.SH\n",
      "600290.SH\n",
      "600289.SH\n",
      "600265.SH\n",
      "600242.SH\n",
      "600241.SH\n",
      "600239.SH\n",
      "600226.SH\n",
      "600217.SH\n",
      "600182.SH\n",
      "600163.SH\n",
      "600139.SH\n",
      "600136.SH\n",
      "600122.SH\n",
      "600112.SH\n",
      "600078.SH\n",
      "600071.SH\n"
     ]
    }
   ],
   "source": [
    "for code in result:\n",
    "    tmp_df = all_stock_holder_df[all_stock_holder_df['ts_code']==code]\n",
    "    if len(tmp_df)>10:\n",
    "        print(code)\n"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "outputs": [
    {
     "data": {
      "text/plain": "     ts_code  ann_date  end_date                  holder_name  hold_amount\n0  600071.SH  20221029  20220930               北京世纪鼎晟咨询服务有限公司     949600.0\n1  600071.SH  20221029  20220930            北京润博翔科技发展中心(有限合伙)     827900.0\n2  600071.SH  20221029  20220930  南方基金稳健增值混合型养老金产品-招商银行股份有限公司     814900.0\n3  600071.SH  20221029  20220930                          牟其波     796000.0\n4  600071.SH  20221029  20220930                   中电海康集团有限公司  132790648.0\n5  600071.SH  20221029  20220930                  中电科投资控股有限公司    6012480.0\n6  600071.SH  20221029  20220930                 北京鼎泽迅捷科技有限公司    1177000.0\n7  600071.SH  20221029  20220930  浮石(北京)投资有限公司-浮石麒麟1号私募证券投资基金    1173100.0\n8  600071.SH  20221029  20220930              北京九鼎房地产开发有限责任公司    1106700.0\n9  600071.SH  20221029  20220930             河北皓佳商务服务中心(有限合伙)     953500.0\n0  600071.SH  20221029  20220930               北京世纪鼎晟咨询服务有限公司     949600.0\n1  600071.SH  20221029  20220930            北京润博翔科技发展中心(有限合伙)     827900.0\n2  600071.SH  20221029  20220930  南方基金稳健增值混合型养老金产品-招商银行股份有限公司     814900.0\n3  600071.SH  20221029  20220930                          牟其波     796000.0\n4  600071.SH  20221029  20220930                   中电海康集团有限公司  132790648.0\n5  600071.SH  20221029  20220930                  中电科投资控股有限公司    6012480.0\n6  600071.SH  20221029  20220930                 北京鼎泽迅捷科技有限公司    1177000.0\n7  600071.SH  20221029  20220930  浮石(北京)投资有限公司-浮石麒麟1号私募证券投资基金    1173100.0\n8  600071.SH  20221029  20220930              北京九鼎房地产开发有限责任公司    1106700.0\n9  600071.SH  20221029  20220930             河北皓佳商务服务中心(有限合伙)     953500.0",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>ts_code</th>\n      <th>ann_date</th>\n      <th>end_date</th>\n      <th>holder_name</th>\n      <th>hold_amount</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>600071.SH</td>\n      <td>20221029</td>\n      <td>20220930</td>\n      <td>北京世纪鼎晟咨询服务有限公司</td>\n      <td>949600.0</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>600071.SH</td>\n      <td>20221029</td>\n      <td>20220930</td>\n      <td>北京润博翔科技发展中心(有限合伙)</td>\n      <td>827900.0</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>600071.SH</td>\n      <td>20221029</td>\n      <td>20220930</td>\n      <td>南方基金稳健增值混合型养老金产品-招商银行股份有限公司</td>\n      <td>814900.0</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>600071.SH</td>\n      <td>20221029</td>\n      <td>20220930</td>\n      <td>牟其波</td>\n      <td>796000.0</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>600071.SH</td>\n      <td>20221029</td>\n      <td>20220930</td>\n      <td>中电海康集团有限公司</td>\n      <td>132790648.0</td>\n    </tr>\n    <tr>\n      <th>5</th>\n      <td>600071.SH</td>\n      <td>20221029</td>\n      <td>20220930</td>\n      <td>中电科投资控股有限公司</td>\n      <td>6012480.0</td>\n    </tr>\n    <tr>\n      <th>6</th>\n      <td>600071.SH</td>\n      <td>20221029</td>\n      <td>20220930</td>\n      <td>北京鼎泽迅捷科技有限公司</td>\n      <td>1177000.0</td>\n    </tr>\n    <tr>\n      <th>7</th>\n      <td>600071.SH</td>\n      <td>20221029</td>\n      <td>20220930</td>\n      <td>浮石(北京)投资有限公司-浮石麒麟1号私募证券投资基金</td>\n      <td>1173100.0</td>\n    </tr>\n    <tr>\n      <th>8</th>\n      <td>600071.SH</td>\n      <td>20221029</td>\n      <td>20220930</td>\n      <td>北京九鼎房地产开发有限责任公司</td>\n      <td>1106700.0</td>\n    </tr>\n    <tr>\n      <th>9</th>\n      <td>600071.SH</td>\n      <td>20221029</td>\n      <td>20220930</td>\n      <td>河北皓佳商务服务中心(有限合伙)</td>\n      <td>953500.0</td>\n    </tr>\n    <tr>\n      <th>0</th>\n      <td>600071.SH</td>\n      <td>20221029</td>\n      <td>20220930</td>\n      <td>北京世纪鼎晟咨询服务有限公司</td>\n      <td>949600.0</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>600071.SH</td>\n      <td>20221029</td>\n      <td>20220930</td>\n      <td>北京润博翔科技发展中心(有限合伙)</td>\n      <td>827900.0</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>600071.SH</td>\n      <td>20221029</td>\n      <td>20220930</td>\n      <td>南方基金稳健增值混合型养老金产品-招商银行股份有限公司</td>\n      <td>814900.0</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>600071.SH</td>\n      <td>20221029</td>\n      <td>20220930</td>\n      <td>牟其波</td>\n      <td>796000.0</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>600071.SH</td>\n      <td>20221029</td>\n      <td>20220930</td>\n      <td>中电海康集团有限公司</td>\n      <td>132790648.0</td>\n    </tr>\n    <tr>\n      <th>5</th>\n      <td>600071.SH</td>\n      <td>20221029</td>\n      <td>20220930</td>\n      <td>中电科投资控股有限公司</td>\n      <td>6012480.0</td>\n    </tr>\n    <tr>\n      <th>6</th>\n      <td>600071.SH</td>\n      <td>20221029</td>\n      <td>20220930</td>\n      <td>北京鼎泽迅捷科技有限公司</td>\n      <td>1177000.0</td>\n    </tr>\n    <tr>\n      <th>7</th>\n      <td>600071.SH</td>\n      <td>20221029</td>\n      <td>20220930</td>\n      <td>浮石(北京)投资有限公司-浮石麒麟1号私募证券投资基金</td>\n      <td>1173100.0</td>\n    </tr>\n    <tr>\n      <th>8</th>\n      <td>600071.SH</td>\n      <td>20221029</td>\n      <td>20220930</td>\n      <td>北京九鼎房地产开发有限责任公司</td>\n      <td>1106700.0</td>\n    </tr>\n    <tr>\n      <th>9</th>\n      <td>600071.SH</td>\n      <td>20221029</td>\n      <td>20220930</td>\n      <td>河北皓佳商务服务中心(有限合伙)</td>\n      <td>953500.0</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "all_stock_holder_df[all_stock_holder_df['ts_code']=='600071.SH']"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "outputs": [],
   "source": [
    "drop_dup = all_stock_holder_df.drop_duplicates(['ts_code','ann_date','holder_name'])\n"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "outputs": [
    {
     "data": {
      "text/plain": "50088"
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(drop_dup)\n"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "outputs": [
    {
     "data": {
      "text/plain": "50777"
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(all_stock_holder_df)"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "688786.SH\n",
      "688621.SH\n",
      "688597.SH\n",
      "688586.SH\n",
      "688569.SH\n",
      "688508.SH\n",
      "688323.SH\n",
      "688303.SH\n",
      "688301.SH\n",
      "688233.SH\n",
      "688203.SH\n",
      "688195.SH\n",
      "688162.SH\n",
      "688100.SH\n",
      "688093.SH\n",
      "688091.SH\n",
      "688082.SH\n",
      "688019.SH\n",
      "605377.SH\n",
      "605366.SH\n",
      "605339.SH\n",
      "605299.SH\n",
      "605189.SH\n",
      "605178.SH\n",
      "605090.SH\n",
      "603993.SH\n",
      "603956.SH\n",
      "603929.SH\n",
      "603881.SH\n",
      "603860.SH\n",
      "603856.SH\n",
      "603813.SH\n",
      "603758.SH\n",
      "603682.SH\n",
      "603615.SH\n",
      "603606.SH\n",
      "603595.SH\n",
      "603501.SH\n",
      "603456.SH\n",
      "603393.SH\n",
      "603348.SH\n",
      "603335.SH\n",
      "603330.SH\n",
      "603319.SH\n",
      "603317.SH\n",
      "603305.SH\n",
      "603303.SH\n",
      "603301.SH\n",
      "603267.SH\n",
      "603200.SH\n",
      "603186.SH\n",
      "603185.SH\n",
      "603169.SH\n",
      "603166.SH\n",
      "603133.SH\n",
      "603105.SH\n",
      "603103.SH\n",
      "603093.SH\n",
      "603077.SH\n",
      "603031.SH\n",
      "603021.SH\n",
      "601996.SH\n",
      "601901.SH\n",
      "601788.SH\n",
      "601766.SH\n",
      "601698.SH\n",
      "601669.SH\n",
      "601633.SH\n",
      "601618.SH\n",
      "601608.SH\n",
      "601390.SH\n",
      "601318.SH\n",
      "601186.SH\n",
      "601138.SH\n",
      "601068.SH\n",
      "601021.SH\n",
      "601006.SH\n",
      "600989.SH\n",
      "600976.SH\n",
      "600973.SH\n",
      "600963.SH\n",
      "600955.SH\n",
      "600887.SH\n",
      "600873.SH\n",
      "600865.SH\n",
      "600862.SH\n",
      "600861.SH\n",
      "600839.SH\n",
      "600820.SH\n",
      "600805.SH\n",
      "600800.SH\n",
      "600795.SH\n",
      "600765.SH\n",
      "600732.SH\n",
      "600719.SH\n",
      "600710.SH\n",
      "600705.SH\n",
      "600698.SH\n",
      "600681.SH\n",
      "600665.SH\n",
      "600660.SH\n",
      "600605.SH\n",
      "600583.SH\n",
      "600577.SH\n",
      "600557.SH\n",
      "600528.SH\n",
      "600523.SH\n",
      "600513.SH\n",
      "600507.SH\n",
      "600488.SH\n",
      "600470.SH\n",
      "600433.SH\n",
      "600423.SH\n",
      "600408.SH\n",
      "600388.SH\n",
      "600380.SH\n",
      "600372.SH\n",
      "600356.SH\n",
      "600332.SH\n",
      "600321.SH\n",
      "600316.SH\n",
      "600305.SH\n",
      "600256.SH\n",
      "600255.SH\n",
      "600252.SH\n",
      "600237.SH\n",
      "600211.SH\n",
      "600168.SH\n",
      "600113.SH\n",
      "600089.SH\n",
      "600063.SH\n",
      "600050.SH\n",
      "600039.SH\n",
      "600038.SH\n",
      "600021.SH\n",
      "600015.SH\n",
      "301256.SZ\n",
      "301192.SZ\n",
      "301179.SZ\n",
      "301171.SZ\n",
      "301127.SZ\n",
      "301076.SZ\n",
      "301071.SZ\n",
      "301066.SZ\n",
      "301059.SZ\n",
      "301046.SZ\n",
      "300896.SZ\n",
      "300890.SZ\n",
      "300818.SZ\n",
      "300796.SZ\n",
      "300765.SZ\n",
      "300750.SZ\n",
      "300721.SZ\n",
      "300708.SZ\n",
      "300700.SZ\n",
      "300674.SZ\n",
      "300654.SZ\n",
      "300496.SZ\n",
      "300422.SZ\n",
      "300401.SZ\n",
      "300354.SZ\n",
      "300349.SZ\n",
      "300346.SZ\n",
      "300286.SZ\n",
      "300281.SZ\n",
      "300211.SZ\n",
      "300146.SZ\n",
      "300139.SZ\n",
      "300120.SZ\n",
      "300087.SZ\n",
      "300059.SZ\n",
      "300033.SZ\n",
      "300006.SZ\n",
      "003816.SZ\n",
      "003037.SZ\n",
      "003011.SZ\n",
      "002984.SZ\n",
      "002972.SZ\n",
      "002966.SZ\n",
      "002947.SZ\n",
      "002916.SZ\n",
      "002912.SZ\n",
      "002881.SZ\n",
      "002879.SZ\n",
      "002865.SZ\n",
      "002846.SZ\n",
      "002812.SZ\n",
      "002805.SZ\n",
      "002782.SZ\n",
      "002777.SZ\n",
      "002759.SZ\n",
      "002741.SZ\n",
      "002682.SZ\n",
      "002668.SZ\n",
      "002667.SZ\n",
      "002616.SZ\n",
      "002579.SZ\n",
      "002566.SZ\n",
      "002560.SZ\n",
      "002556.SZ\n",
      "002532.SZ\n",
      "002514.SZ\n",
      "002419.SZ\n",
      "002379.SZ\n",
      "002315.SZ\n",
      "002285.SZ\n",
      "002258.SZ\n",
      "002240.SZ\n",
      "002233.SZ\n",
      "002190.SZ\n",
      "002188.SZ\n",
      "002179.SZ\n",
      "002162.SZ\n",
      "002138.SZ\n",
      "002134.SZ\n",
      "002105.SZ\n",
      "002080.SZ\n",
      "002072.SZ\n",
      "002056.SZ\n",
      "002014.SZ\n",
      "001979.SZ\n",
      "001914.SZ\n",
      "001207.SZ\n",
      "001205.SZ\n",
      "000988.SZ\n",
      "000975.SZ\n",
      "000972.SZ\n",
      "000915.SZ\n",
      "000815.SZ\n",
      "000798.SZ\n",
      "000795.SZ\n",
      "000783.SZ\n",
      "000739.SZ\n",
      "000708.SZ\n",
      "000702.SZ\n",
      "000690.SZ\n",
      "000665.SZ\n",
      "000663.SZ\n",
      "000608.SZ\n",
      "000534.SZ\n",
      "000503.SZ\n",
      "000408.SZ\n",
      "000407.SZ\n",
      "000063.SZ\n",
      "000062.SZ\n",
      "000061.SZ\n",
      "000055.SZ\n",
      "000050.SZ\n",
      "000048.SZ\n",
      "000029.SZ\n",
      "000026.SZ\n",
      "000001.SZ\n",
      "600732.SH\n",
      "600719.SH\n",
      "600710.SH\n",
      "600408.SH\n",
      "600388.SH\n"
     ]
    }
   ],
   "source": [
    "for code in result:\n",
    "    tmp_df = drop_dup[drop_dup['ts_code']==code]\n",
    "    if len(tmp_df)>10:\n",
    "        print(code)\n"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "outputs": [
    {
     "data": {
      "text/plain": "      ts_code  ann_date  end_date                       holder_name  \\\n0   600388.SH  20230318  20221231            福建龙净环保股份有限公司-第七期员工持股计划   \n1   600388.SH  20230318  20221231                               李亚洲   \n2   600388.SH  20230318  20221231        深圳市云古投资有限公司-云古湛卢1号私募证券投资基金   \n3   600388.SH  20230318  20221231                      紫金矿业集团股份有限公司   \n4   600388.SH  20230318  20221231                   龙岩市国有资产投资经营有限公司   \n5   600388.SH  20230318  20221231                      龙净实业投资集团有限公司   \n6   600388.SH  20230318  20221231                      西藏阳光泓瑞工贸有限公司   \n7   600388.SH  20230318  20221231       深圳永冠基金管理有限公司-永冠新瑞1号私募证券投资基金   \n8   600388.SH  20230318  20221231  深圳市恒泰融安投资管理有限公司-恒泰融安瑞狮1号私募证券投资基金   \n9   600388.SH  20230318  20221231                        平潭润垚实业有限公司   \n10  600388.SH  20221018  20220930                      紫金矿业集团股份有限公司   \n11  600388.SH  20221018  20220930                   龙岩市国有资产投资经营有限公司   \n12  600388.SH  20221018  20220930                      龙净实业投资集团有限公司   \n13  600388.SH  20221018  20220930                      西藏阳光泓瑞工贸有限公司   \n14  600388.SH  20221018  20220930       深圳永冠基金管理有限公司-永冠新瑞1号私募证券投资基金   \n15  600388.SH  20221018  20220930  深圳市恒泰融安投资管理有限公司-恒泰融安瑞狮1号私募证券投资基金   \n16  600388.SH  20221018  20220930                        平潭润垚实业有限公司   \n17  600388.SH  20221018  20220930            福建龙净环保股份有限公司-第七期员工持股计划   \n18  600388.SH  20221018  20220930        深圳市云古投资有限公司-云古湛卢1号私募证券投资基金   \n19  600388.SH  20221018  20220930                     龙岩市电力建设发展有限公司   \n\n    hold_amount  \n0     9759390.0  \n1     8960604.0  \n2     8685250.0  \n3   160586231.0  \n4   100371338.0  \n5    84310926.0  \n6    22807835.0  \n7    15600000.0  \n8    11349914.0  \n9    10040000.0  \n10  160586231.0  \n11  100371338.0  \n12   84310926.0  \n13   22807835.0  \n14   13999000.0  \n15   11345206.0  \n16   10040000.0  \n17    9759390.0  \n18    8685250.0  \n19    8632545.0  ",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>ts_code</th>\n      <th>ann_date</th>\n      <th>end_date</th>\n      <th>holder_name</th>\n      <th>hold_amount</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>600388.SH</td>\n      <td>20230318</td>\n      <td>20221231</td>\n      <td>福建龙净环保股份有限公司-第七期员工持股计划</td>\n      <td>9759390.0</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>600388.SH</td>\n      <td>20230318</td>\n      <td>20221231</td>\n      <td>李亚洲</td>\n      <td>8960604.0</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>600388.SH</td>\n      <td>20230318</td>\n      <td>20221231</td>\n      <td>深圳市云古投资有限公司-云古湛卢1号私募证券投资基金</td>\n      <td>8685250.0</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>600388.SH</td>\n      <td>20230318</td>\n      <td>20221231</td>\n      <td>紫金矿业集团股份有限公司</td>\n      <td>160586231.0</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>600388.SH</td>\n      <td>20230318</td>\n      <td>20221231</td>\n      <td>龙岩市国有资产投资经营有限公司</td>\n      <td>100371338.0</td>\n    </tr>\n    <tr>\n      <th>5</th>\n      <td>600388.SH</td>\n      <td>20230318</td>\n      <td>20221231</td>\n      <td>龙净实业投资集团有限公司</td>\n      <td>84310926.0</td>\n    </tr>\n    <tr>\n      <th>6</th>\n      <td>600388.SH</td>\n      <td>20230318</td>\n      <td>20221231</td>\n      <td>西藏阳光泓瑞工贸有限公司</td>\n      <td>22807835.0</td>\n    </tr>\n    <tr>\n      <th>7</th>\n      <td>600388.SH</td>\n      <td>20230318</td>\n      <td>20221231</td>\n      <td>深圳永冠基金管理有限公司-永冠新瑞1号私募证券投资基金</td>\n      <td>15600000.0</td>\n    </tr>\n    <tr>\n      <th>8</th>\n      <td>600388.SH</td>\n      <td>20230318</td>\n      <td>20221231</td>\n      <td>深圳市恒泰融安投资管理有限公司-恒泰融安瑞狮1号私募证券投资基金</td>\n      <td>11349914.0</td>\n    </tr>\n    <tr>\n      <th>9</th>\n      <td>600388.SH</td>\n      <td>20230318</td>\n      <td>20221231</td>\n      <td>平潭润垚实业有限公司</td>\n      <td>10040000.0</td>\n    </tr>\n    <tr>\n      <th>10</th>\n      <td>600388.SH</td>\n      <td>20221018</td>\n      <td>20220930</td>\n      <td>紫金矿业集团股份有限公司</td>\n      <td>160586231.0</td>\n    </tr>\n    <tr>\n      <th>11</th>\n      <td>600388.SH</td>\n      <td>20221018</td>\n      <td>20220930</td>\n      <td>龙岩市国有资产投资经营有限公司</td>\n      <td>100371338.0</td>\n    </tr>\n    <tr>\n      <th>12</th>\n      <td>600388.SH</td>\n      <td>20221018</td>\n      <td>20220930</td>\n      <td>龙净实业投资集团有限公司</td>\n      <td>84310926.0</td>\n    </tr>\n    <tr>\n      <th>13</th>\n      <td>600388.SH</td>\n      <td>20221018</td>\n      <td>20220930</td>\n      <td>西藏阳光泓瑞工贸有限公司</td>\n      <td>22807835.0</td>\n    </tr>\n    <tr>\n      <th>14</th>\n      <td>600388.SH</td>\n      <td>20221018</td>\n      <td>20220930</td>\n      <td>深圳永冠基金管理有限公司-永冠新瑞1号私募证券投资基金</td>\n      <td>13999000.0</td>\n    </tr>\n    <tr>\n      <th>15</th>\n      <td>600388.SH</td>\n      <td>20221018</td>\n      <td>20220930</td>\n      <td>深圳市恒泰融安投资管理有限公司-恒泰融安瑞狮1号私募证券投资基金</td>\n      <td>11345206.0</td>\n    </tr>\n    <tr>\n      <th>16</th>\n      <td>600388.SH</td>\n      <td>20221018</td>\n      <td>20220930</td>\n      <td>平潭润垚实业有限公司</td>\n      <td>10040000.0</td>\n    </tr>\n    <tr>\n      <th>17</th>\n      <td>600388.SH</td>\n      <td>20221018</td>\n      <td>20220930</td>\n      <td>福建龙净环保股份有限公司-第七期员工持股计划</td>\n      <td>9759390.0</td>\n    </tr>\n    <tr>\n      <th>18</th>\n      <td>600388.SH</td>\n      <td>20221018</td>\n      <td>20220930</td>\n      <td>深圳市云古投资有限公司-云古湛卢1号私募证券投资基金</td>\n      <td>8685250.0</td>\n    </tr>\n    <tr>\n      <th>19</th>\n      <td>600388.SH</td>\n      <td>20221018</td>\n      <td>20220930</td>\n      <td>龙岩市电力建设发展有限公司</td>\n      <td>8632545.0</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "drop_dup[drop_dup['ts_code']=='600388.SH']"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "outputs": [],
   "source": [
    "last_year_df = drop_dup[drop_dup['end_date']=='20220930']"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "outputs": [
    {
     "data": {
      "text/plain": "47999"
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(last_year_df)"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "outputs": [
    {
     "data": {
      "text/plain": "      ts_code  ann_date  end_date                       holder_name  \\\n8   688668.SH  20221019  20220930  中国农业银行股份有限公司-工银瑞信战略转型主题股票型证券投资基金   \n0   688382.SH  20221027  20220930    中国建设银行股份有限公司-工银瑞信前沿医疗股票型证券投资基金   \n5   688381.SH  20221029  20220930      平安银行股份有限公司-招商瑞信稳健配置混合型证券投资基金   \n17  688301.SH  20221031  20220930    中国建设银行股份有限公司-工银瑞信前沿医疗股票型证券投资基金   \n1   688293.SH  20221027  20220930    中国建设银行股份有限公司-工银瑞信前沿医疗股票型证券投资基金   \n..        ...       ...       ...                               ...   \n9   000400.SZ  20221028  20220930        工银瑞信基金-农业银行-工银瑞信中证金融资产管理计划   \n7   000100.SZ  20221025  20220930        工银瑞信基金-农业银行-工银瑞信中证金融资产管理计划   \n6   000099.SZ  20221028  20220930    中国农业银行股份有限公司-工银瑞信创新动力股票型证券投资基金   \n9   000088.SZ  20221028  20220930        工银瑞信基金-农业银行-工银瑞信中证金融资产管理计划   \n7   000031.SZ  20221031  20220930          工银瑞信投资-工商银行-中国工商银行股份有限公司   \n\n   hold_amount  \n8     528214.0  \n0    2000008.0  \n5     576795.0  \n17   1006266.0  \n1     700018.0  \n..         ...  \n9    6674795.0  \n7   74761500.0  \n6    3300000.0  \n9   17266196.0  \n7   38512834.0  \n\n[136 rows x 5 columns]",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>ts_code</th>\n      <th>ann_date</th>\n      <th>end_date</th>\n      <th>holder_name</th>\n      <th>hold_amount</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>8</th>\n      <td>688668.SH</td>\n      <td>20221019</td>\n      <td>20220930</td>\n      <td>中国农业银行股份有限公司-工银瑞信战略转型主题股票型证券投资基金</td>\n      <td>528214.0</td>\n    </tr>\n    <tr>\n      <th>0</th>\n      <td>688382.SH</td>\n      <td>20221027</td>\n      <td>20220930</td>\n      <td>中国建设银行股份有限公司-工银瑞信前沿医疗股票型证券投资基金</td>\n      <td>2000008.0</td>\n    </tr>\n    <tr>\n      <th>5</th>\n      <td>688381.SH</td>\n      <td>20221029</td>\n      <td>20220930</td>\n      <td>平安银行股份有限公司-招商瑞信稳健配置混合型证券投资基金</td>\n      <td>576795.0</td>\n    </tr>\n    <tr>\n      <th>17</th>\n      <td>688301.SH</td>\n      <td>20221031</td>\n      <td>20220930</td>\n      <td>中国建设银行股份有限公司-工银瑞信前沿医疗股票型证券投资基金</td>\n      <td>1006266.0</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>688293.SH</td>\n      <td>20221027</td>\n      <td>20220930</td>\n      <td>中国建设银行股份有限公司-工银瑞信前沿医疗股票型证券投资基金</td>\n      <td>700018.0</td>\n    </tr>\n    <tr>\n      <th>...</th>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n    </tr>\n    <tr>\n      <th>9</th>\n      <td>000400.SZ</td>\n      <td>20221028</td>\n      <td>20220930</td>\n      <td>工银瑞信基金-农业银行-工银瑞信中证金融资产管理计划</td>\n      <td>6674795.0</td>\n    </tr>\n    <tr>\n      <th>7</th>\n      <td>000100.SZ</td>\n      <td>20221025</td>\n      <td>20220930</td>\n      <td>工银瑞信基金-农业银行-工银瑞信中证金融资产管理计划</td>\n      <td>74761500.0</td>\n    </tr>\n    <tr>\n      <th>6</th>\n      <td>000099.SZ</td>\n      <td>20221028</td>\n      <td>20220930</td>\n      <td>中国农业银行股份有限公司-工银瑞信创新动力股票型证券投资基金</td>\n      <td>3300000.0</td>\n    </tr>\n    <tr>\n      <th>9</th>\n      <td>000088.SZ</td>\n      <td>20221028</td>\n      <td>20220930</td>\n      <td>工银瑞信基金-农业银行-工银瑞信中证金融资产管理计划</td>\n      <td>17266196.0</td>\n    </tr>\n    <tr>\n      <th>7</th>\n      <td>000031.SZ</td>\n      <td>20221031</td>\n      <td>20220930</td>\n      <td>工银瑞信投资-工商银行-中国工商银行股份有限公司</td>\n      <td>38512834.0</td>\n    </tr>\n  </tbody>\n</table>\n<p>136 rows × 5 columns</p>\n</div>"
     },
     "execution_count": 52,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "tmp_result = last_year_df[last_year_df['holder_name'].str.contains('瑞信')]\n",
    "tmp_result"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "ts_code           600151.SH\n",
      "ann_date           20221029\n",
      "end_date           20220930\n",
      "holder_name    瑞士信贷(香港)有限公司\n",
      "hold_amount      12483068.0\n",
      "Name: 6, dtype: object\n",
      "ts_code           300554.SZ\n",
      "ann_date           20221028\n",
      "end_date           20220930\n",
      "holder_name    瑞士信贷(香港)有限公司\n",
      "hold_amount        428693.0\n",
      "Name: 8, dtype: object\n"
     ]
    }
   ],
   "source": [
    "for index,row in tmp_result.iterrows():\n",
    "    if '工银' in row['holder_name'] or '嘉盛' in row['holder_name']:\n",
    "        continue\n",
    "    print(row)"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "outputs": [
    {
     "data": {
      "text/plain": "     ts_code  ann_date  end_date      holder_name hold_amount\n6  600151.SH  20221029  20220930     瑞士信贷(香港)有限公司  12483068.0\n8  600151.SH  20221029  20220930  瑞士嘉盛银行有限公司-自有资金  11199911.0\n8  300554.SZ  20221028  20220930     瑞士信贷(香港)有限公司    428693.0",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>ts_code</th>\n      <th>ann_date</th>\n      <th>end_date</th>\n      <th>holder_name</th>\n      <th>hold_amount</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>6</th>\n      <td>600151.SH</td>\n      <td>20221029</td>\n      <td>20220930</td>\n      <td>瑞士信贷(香港)有限公司</td>\n      <td>12483068.0</td>\n    </tr>\n    <tr>\n      <th>8</th>\n      <td>600151.SH</td>\n      <td>20221029</td>\n      <td>20220930</td>\n      <td>瑞士嘉盛银行有限公司-自有资金</td>\n      <td>11199911.0</td>\n    </tr>\n    <tr>\n      <th>8</th>\n      <td>300554.SZ</td>\n      <td>20221028</td>\n      <td>20220930</td>\n      <td>瑞士信贷(香港)有限公司</td>\n      <td>428693.0</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "execution_count": 48,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "tmp_result\n"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "outputs": [],
   "source": [],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}